using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class AudioManager : MonoBehaviour
{
    public static AudioManager instance;

    public AudioClip[] audioClips;
    private AudioSource audioSource;

    public void Awake()
    {
        audioSource = GetComponent<AudioSource>();

        if (instance == null)
            instance = this;
        else
            Destroy(gameObject);
    }
    // Update is called once per frame
    public void Play_BackGround_Music()
    {
        audioSource.Pause();
        int play_index = Random.Range(0, 3);
        audioSource.clip = audioClips[play_index];
        audioSource.Play();
    }

    public void Play_Victory_Music()
    {
        audioSource.Pause();
        audioSource.clip = audioClips[3];
        audioSource.Play();
    }

    public void Stop_current_Music()
    {
        audioSource.Stop();
    }

    public void Play_Chest_Sound()
    {
        audioSource.clip = audioClips[4];
        audioSource.Play();

    }

}
